import { Selector } from '@ngxs/store';
import { SystemState, SystemStateModel } from './system.state';

export class SystemSelector {
  @Selector([SystemState])
  static tempData({tempData}: SystemStateModel) {
    return tempData;
  }

  @Selector([SystemState])
  static isCollapsed({isCollapsed}: SystemStateModel) {
    return isCollapsed;
  }

  @Selector([SystemState])
  static collapsedType({isCollapsed}: SystemStateModel) {
    return isCollapsed ? 'menu-unfold' : 'menu-fold';
  }

  @Selector([SystemState])
  static isLogin({isLogin}: SystemStateModel) {
    return isLogin;
  }

  @Selector([SystemState])
  static token({token}: SystemStateModel) {
    return token;
  }

  @Selector([SystemState])
  static emailAddr({emailAddr}: SystemStateModel) {
    return emailAddr;
  }

}
